package com.chexiehui.jc.mvp.home;

import com.chexiehui.jc.Constants;
import com.chexiehui.jc.base.BaseModel;
import com.chexiehui.jc.base.BasePage;
import com.chexiehui.jc.base.BaseView;
import com.chexiehui.jc.entity.CarSeriesInfo;
import com.chexiehui.jc.entity.DictInfo;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * @Description 条件选车
 * @Auth SongJun
 * @Date 2019/11/20 10:05
 **/
public interface ConditionalCarSelectionCovenant {

    interface View extends BaseView {
        void onGetListSuccess(BaseModel<BasePage<CarSeriesInfo>> successResult);

        void onGetListFailure(BaseModel<Object> failureResult);

        void onGetCraGradeListSuccess(BaseModel<List<DictInfo>> successResult);

        void onGetCraGradeListFailure(BaseModel<Object> failureResult);

        void onGetCountryTypeListSuccess(BaseModel<List<DictInfo>> successResult);

        void onGetCountryTypeListFailure(BaseModel<Object> failureResult);

        String getBrandId();

        String getPriceMin();

        String getPriceMax();

        String getCarType();

        String getCarCountry();
    }

    interface Stores {

        @FormUrlEncoded
        @POST(Constants.URL_CAR_GRADE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCraGradeList(@Field("timespan") String timespan);

        @FormUrlEncoded
        @POST(Constants.URL_COUNTRY_TYPE_LIST)
        Observable<BaseModel<List<DictInfo>>> getCountryTypeList(@Field("timespan") String timespan);

        @FormUrlEncoded
        @POST(Constants.URL_CONDITIONAL_CAR_SELECTION)
        Observable<BaseModel<BasePage<CarSeriesInfo>>> getList(
                @Field("priceMin") String priceMin,
                @Field("priceMax") String priceMax,
                @Field("country") String country,
                @Field("brandId") String brandId,
                @Field("type") String type,
                @Field("pageIndex") int pageIndex,
                @Field("pageSize") int pageSize);
    }

    interface Presenter {
        void getCraGradeList();

        void getCountryTypeList();

        void getList(int pageNum);

    }

}